package org.frog.sgs.client.process.all;

import org.apache.mina.core.session.IoSession;
import org.frog.sgs.card.role.Role;
import org.frog.sgs.client.game.ClientInstance;
import org.frog.sgs.client.process.ClientProcessor;
import org.frog.sgs.data.GameDataManager;
import org.frog.sgs.io.SgsMsg;

/**
 * @author duanxiangqi
 * @date 2012-10-26
 */
public class ClientProcessorChooseRole implements ClientProcessor {

	public void process(IoSession session, SgsMsg msg, ClientInstance instance) throws Exception {
		int roleId = msg.readInt();
		int position = msg.readInt();
		Role role = GameDataManager.instance.getRoleCopy(roleId);
		instance.setRole(role);
		instance.setPosition(position);
		System.out.println("您的身份是：" + instance.getName() + "，位置：" + position);
	}
}
